package com.mutual.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SuppressWarnings("deprecation")
@Configuration
public class CrossDomainConfig extends WebMvcConfigurationSupport{

	 @Override
	    public void addCorsMappings(CorsRegistry registry) {
	        registry.addMapping("/**").allowedOrigins("*")
	                .allowedMethods("GET", "HEAD", "POST","PUT", "DELETE", "OPTIONS")
	                .allowCredentials(false).maxAge(3600);
	    }
}